﻿using System;
using AjaxControlToolkit;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.ComponentModel;

[assembly: WebResource("jQueryNET.Common.ControlBase.js", "application/x-javascript")]

namespace jQueryNET
{
	[RequiredScript(typeof(Common), 0)]
	[ClientScriptResource("jQueryNET.Controls.ControlBase", "jQueryNET.Common.ControlBase.js")]
	public class ControlBase : ScriptControlBase
	{
		#region Public consturctors

		/// <summary>
		/// Initializes a new ScriptControl
		/// </summary>
		/// <param name="tag"></param>
		public ControlBase(HtmlTextWriterTag tag)
			: base(tag)
		{

		}
		/// <summary>
		/// Initializes a new ScriptControl
		/// </summary>
		protected ControlBase()
		{
			
		}
		/// <summary>
		/// Initializes a new ScriptControl
		/// </summary>
		/// <param name="tag"></param>
		protected ControlBase(string tag)
			: base(tag)
		{
			
		}
		/// <summary>
		/// Initializes a new ScriptControl
		/// </summary>
		/// <param name="enableClientState"></param>
		protected ControlBase(bool enableClientState)
			: base(enableClientState)
		{
			
		}
		/// <summary>
		/// Initializes a new ScriptControl
		/// </summary>
		/// <param name="enableClientState"></param>
		/// <param name="tag"></param>
		protected ControlBase(bool enableClientState, HtmlTextWriterTag tag)
			: base(enableClientState, tag)
		{
			
		}
		/// <summary>
		/// Initializes a new ScriptControl
		/// </summary>
		/// <param name="enableClientState"></param>
		/// <param name="tag"></param>
		protected ControlBase(bool enableClientState, string tag)
			: base(enableClientState, tag)
		{
			
		}
		#endregion

		#region Public properties

		/// <summary>
		/// 
		/// </summary>
		[ExtenderControlProperty]
		[ClientPropertyName("width")]
		public override Unit Width
		{
			get
			{
				return base.Width;
			}
			set
			{
				base.Width = value;
			}
		}

		/// <summary>
		/// 
		/// </summary>
		[ExtenderControlProperty]
		[ClientPropertyName("height")]
		public override Unit Height
		{
			get
			{
				return base.Height;
			}
			set
			{
				base.Height = value;
			}
		}

		[Description("Control theme")]
		[Category("Behavior")]
		[ExtenderControlProperty]
		[ClientPropertyName("theme")]
		public string Theme
		{
			get { return (string)(ViewState["Theme"]?? "default"); }
			set { ViewState["Theme"] = value; }
		}

		[DefaultValue("")]
		[Category("Behavior")]
		[ExtenderControlEvent]
		[ClientPropertyName("active")]
		public string OnActive
		{
			get { return (string)(ViewState["OnActive"] ?? string.Empty); }
			set { ViewState["OnActive"] = value; }
		}

		[DefaultValue("")]
		[Category("Behavior")]
		[ExtenderControlEvent]
		[ClientPropertyName("deactive")]
		public string OnDeactive
		{
			get { return (string)(ViewState["OnDeactive"] ?? string.Empty); }
			set { ViewState["OnDeactive"] = value; }
		}

		#endregion
	}
}
